package com.ihr360.payroll.dao;

import com.ihr360.payroll.model.dto.salary.task.period.StaffPayPeriodTermSalary;
import com.ihr360.payroll.model.dto.salary.task.period.embeddable.StaffSalaryTermId;
import com.ihr360.rest.reposity.SimpleRestReposity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Collection;
import java.util.List;

public interface StaffPayPeriodTermSalaryRepository extends SimpleRestReposity<StaffPayPeriodTermSalary, StaffSalaryTermId> {

    List<StaffPayPeriodTermSalary> findByIdTermIdAndIdStaffIdIn(Long termId, Collection<String> ids);

    List<StaffPayPeriodTermSalary> findAllByIdTermId(Long termId);

    void deleteAllByIdTermIdIn(List<Long> termIds);

    void deleteAllByIdTermIdAndIdStaffIdIn(Long termId, Collection<String> ids);

    Page<StaffPayPeriodTermSalary> findByCompanyIdAndIdTermIdAndIdStaffIdIn(String companyId, Long termId, List<String> staffIdList, Pageable pageable);

    List<StaffPayPeriodTermSalary> findByCompanyIdAndIdTermIdAndIdStaffIdIn(String companyId, Long termId, List<String> staffIdList);

    List<StaffPayPeriodTermSalary> findByCompanyIdAndIdStaffId(String companyId, String staffId);

    List<StaffPayPeriodTermSalary> findByCompanyIdAndIdTermId(String companyId, Long termId);

    List<StaffPayPeriodTermSalary> findByCompanyIdAndIdTermIdInAndIdStaffIdIn(String companyId, List<Long> termIdList, List<String> staffIdList);

    Page<StaffPayPeriodTermSalary> findByCompanyIdAndIdTermIdInAndIdStaffIdIn(String companyId, List<Long> termIdList, List<String> staffIdList, Pageable pageable);

    List<StaffPayPeriodTermSalary> findByCompanyIdAndIdTermIdIn(String companyId, List<Long> termIdList);
}